import {onBeforeMount } from 'vue'

export default function () {

    let authBtns = []

    onBeforeMount(function () {
        let item = sessionStorage.getItem("authBtns");
        if(item){
            authBtns = JSON.parse(item)
        }
    })
    function hasBtnAuth(path) {
        for(let i=0 ; i<authBtns.length ; i++){
            if(authBtns[i] == path){
                return true
            }
        }
        return false
    }

    return {hasBtnAuth}
}